<?php
namespace addons\huochetou\controller;
use think\Request;
use think\Loader;
use think\Db;

use app\common\controller\AdminBase;

class ApiAdminHuochetou extends AdminBase
{

    public function setPassword()
    {
        $password = input('post.password');
        if (!$password) {
            $password = 'www.ssycms.com';
        }
        db('BaseKey')->where('key','huochetou')->update(array('val' => $password));
        return jsonSuccess('操作成功');
    }

    public function getPassword()
    {
        return jsonSuccess('',db('BaseKey')->where('key','huochetou')->find()['val']);
    }
}